<%@ page language="java" contentType="text/html; charset=UTF-8" %>


	<form action="${cpath}/shequ.do?action=adlist" name="searchForm"  method="post" >
	<div class="search"><span>搜索:</span><input type="radio" name="findtype" class="pr" name="mod" value="shequ" checked="checked"  onclick="javascript:chg();"/> 社区
	<input type="radio" name="findtype" value="user" class="pr" /> 用户&nbsp;
	<input type="text" name='findstr' value='' maxlength="100" class="in"/>&nbsp;&nbsp;
	<button type="button" name="searchsubmit" class="xw1" onclick="javascript:dosearch();"></button>
	<!--<a href="#" target="_blank" class="xi2">高级搜索</a>-->
	</div>
	<input type="hidden" name='village' value=''/>
	<input type="hidden" name='qryNick' value=''/>
	</form>
<script>
	function dosearch()
	{
		var form = document.searchForm;
		var findstr = form['findstr'];
		if(findstr.value == "" || findstr.value.replace(/(^\s*)|(\s*$)/g,"").length < 1){
			alert("请输入搜索内容！");
			form['findstr'].focus();
			return ;
		}
		var resualt=false;
		for(var i=0;i<document.searchForm.findtype.length;i++)
		{			
			if(document.searchForm.findtype[i].checked)
			{
			  resualt=document.searchForm.findtype[i].value;
			}
		}
		var village = form['village'];
		var qryNick = form['qryNick'];
		if(resualt == "shequ"){

			village.value = findstr.value;
			document.searchForm.action = "/shequ.do?action=adlist";
		}else{

			qryNick.value = findstr.value;
			document.searchForm.action = "/userhome.do?action=selist";
		}
		form.submit();
	}
</script>